package com.sc.nft.dto;

import cn.hutool.core.date.DateTime;
import lombok.extern.slf4j.Slf4j;
import com.sc.nft.entity.UserEcologyHatchIncomeRecord;
import com.sc.nft.mapper.UserEcologyHatchIncomeRecordMapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Repository;

import java.math.BigDecimal;
import java.util.List;

/**
 * 生态-用户收益记录表(sc_user_ecology_hatch_income_record)数据DAO
 *
 * @author Sun
 * @since 2023-10-13 17:22:12
 * @description 由 Mybatisplus Code Generator 创建
 */
@Slf4j
@Repository
public class UserEcologyHatchIncomeRecordDao extends ServiceImpl<UserEcologyHatchIncomeRecordMapper, UserEcologyHatchIncomeRecord> {

    public BigDecimal getSumIncomeByUserId(Long userId) {
        return baseMapper.getSumIncomeByUserId(userId);
    }

    public BigDecimal getLastWeekSumIncome() {
      return  baseMapper.getLastWeekSumIncome();
    }

    /**
     * 获取平台这周收益总和
     *
     * @return
     */
    public List<EcologicalBenefitDTO> capturePlatformRevenue(){
        return  baseMapper.capturePlatformRevenue();
    }

    /**
     * 获取DAO这周收益总和
     *
     * @return
     */
    public List<EcologicalBenefitDTO> captureDaoRevenue(){
        return  baseMapper.captureDaoRevenue();
    }
}